#!/usr/bin/python3.8
# -*- coding: utf-8 -*-
# @Time    : 2021/3/6 7:18 下午 
# @Author  : zhaohexin
# @Email   : 1483643520@xxx.com
# @File    : schemas.py
# @Software: PyCharm 
# @FileDescription：岗位校验器

from typing import Optional
from pydantic import BaseModel

from common.BaseSchemas import BaseSchemas


class DeptsBase(BaseSchemas):
    """
    岗位通用校验
    """
    pid: Optional[int] = None
    sub_count: Optional[int] = 0
    name: str
    sort: Optional[int] = 0
    enabled = bool


class DeptsWeb(BaseModel):
    """
    后端返回前端校验
    """
    deptSort: Optional[int] = 0
    id: int
    enabled: bool
    name: str
    label: str
    leaf: bool
    hasChildren: bool
    subCount: Optional[int] = 0
    createTime: Optional[str] = None
    updateTime: Optional[str] = None
    creatBy: Optional[str] = None
